.TH std::locale::global 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::locale::global \- std::locale::global

.SH Synopsis
   Defined in header <locale>
   static locale global( const locale& loc );

   Replaces the global C++ locale with loc, which means all future calls to the
   std::locale default constructor will now return a copy of loc. If loc has a name,
   also replaces the C locale as if by std::setlocale(LC_ALL, loc.name().c_str());.
   This function is the only way to modify the global C++ locale, which is otherwise
   equivalent to std::locale::classic() at program startup.

.SH Parameters

   loc - the new global C++ locale

.SH Return value

   The previous value of the global C++ locale.

.SH Example

    This section is incomplete
    Reason: no example

   Defect reports

   The following behavior-changing defect reports were applied retroactively to
   previously published C++ standards.

    DR   Applied to              Behavior as published               Correct behavior
                    it was unspecified whether other library        specified (no other
   LWG 8 C++98      functions (such                                 library functions
                    as std::setlocale) can modify the global C++    allowed)
                    locale

.SH See also

   constructor   constructs a new locale
                 \fI(public member function)\fP
   classic       obtains a reference to the "C" locale
   \fB[static]\fP      \fI(public static member function)\fP
   setlocale     gets and sets the current C locale
                 \fI(function)\fP

.SH Category:
     * Todo no example
